import Vue from 'vue'
import Router from 'vue-router'
import Layout from '@/views/layout/index.vue'

import base from './modules/base.js'
import user from './modules/user.js'
import good from './modules/good.js'
import order from './modules/order.js'
import article from './modules/article.js'
import comp from './modules/comp.js'
import mudan from './modules/mudan.js'
import vip from './modules/vip.js'

Vue.use(Router)

export const routes= [
  {
    path:'/',
    redirect:'/home',
    meta:{hide:true}
  },
  {
    path: '/home',
    component: Layout,
    redirect: '/home/admin',
    meta:{title:'首页',icon:"el-icon-star-on"},
    children: [
      {
        path: 'admin',
        component: () => import('@/views/home/admin.vue'),
        meta:{title:'首页',affix:true},
      }
    ]
  },
  base,
  user,
  good,
  order,
  article,
  comp,
  mudan,
  vip,
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/login/login.vue'),
    meta:{title:'Login',icon:"el-icon-star-on",hide:true},
  },
  {
    path: '/xx',
    name:'xx',
    component: () => import('@/views/xTest/index.vue'),
    meta:{title:'xx',icon:"el-icon-star-on",hide:true},
  },
  {
    path: '*',
    component: () => import('@/views/error/404.vue'),
    meta:{title:'404',icon:"el-icon-star-on",hide:true},
  }
]

export default new Router({
  routes: routes
})
